package com.txh.blog.util;

import com.txh.blog.consts.ResultEnum;
import com.txh.blog.vo.ResultJson;

/**
 * json信息帮助类
 */
public class ResultJsonUtils {

    private ResultJsonUtils(){

    }

    public static ResultJson success(Object data){
        return new ResultJson(ResultEnum.SUCCESS.getCode(),ResultEnum.SUCCESS.getMsg(),data);
    }

    public static ResultJson error(ResultEnum error){
        return new ResultJson(error.getCode(),error.getMsg(),null);
    }

    public static ResultJson systemError(String e){
        return new ResultJson(ResultEnum.EXCEPTION.getCode(),e,null);
    }
}
